<template>
  <div class="add-template-dialog">
    <a-form-model
      ref="ruleForm"
      :model="form"
      :rules="rules"
    >
      <a-form-model-item label="名称" prop="name">
        <a-input v-model="form.name"></a-input>
      </a-form-model-item>
      <a-form-model-item label="描述信息" prop="desc">
        <a-input v-model="form.desc"></a-input>
      </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
export default {
  name: 'addTemplateDialog',
  data () {
    return {
      form: {
        name: '',
        desc: ''
      },
      rules: {
        name: [{ required: true, message: '请输入名称', trigger: 'change' }],
        desc: [{ required: true, message: '请输入描述信息', trigger: 'change' }]
      }
    }
  },
  methods: {
    submit () {
      let isValid
      this.$refs.ruleForm.validate(valid => {
        isValid = valid
      })
      return isValid
    }
  }
}
</script>

<style scoped>

</style>
